<template>
    <div>
        <h1>测试Pinia</h1>
        <p>count：{{ count }}</p>
        <p>计算属性：{{ doubleCount }}</p>
        <input type="button" value="add" @click="handleAdd">
    </div>
</template>
<script setup>
import {useCounterStore} from '../stores/counter';
import { storeToRefs } from 'pinia';
const couterStore = useCounterStore();
const {count,doubleCount} = storeToRefs(couterStore);
const {increment} = couterStore;
function handleAdd(){
    // count.value++;
    increment();
}
</script>